BC54 获得月份天数
KiKi想获得某年某月有多少天，请帮他编程实现。输入年份和月份，计算这一年这个月有多少天。
https://www.nowcoder.com/practice/13aeae34f8ed4697960f7cfc80f9f7f6?tpId=107&&tqId=33335&rp=1&ru=/ta/beginner-programmers&qru=/ta/beginner-programmers/question-ranking


#include <stdio.h>

//4年一闰，百年不闰，400一闰
int IsLeap(int year)
{
    if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
    {
        return 1;
    }
    return 0;
}

int main()
{
    int year = 0;
    int month = 0;
    int monthday[13] = { 0,31,28,31,30,31,
    30,31,31,30,31,30,31 };
    while (~scanf(" %d%d", &year, &month))
    {
        int day = monthday[month];
        if ((IsLeap(year) == 1) && month == 2)
        {
            day++;
        }
        printf("%d\n", day);
    }

    return 0;
}